//- Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. 
//- <https://www.chatopera.com>, Licensed under the Chunsong Public 
//- License, Version 1.0  (the "License"), https://docs.cskefu.com/licenses/v1.html
//- Unless required by applicable law or agreed to in writing, software
//- distributed under the License is distributed on an "AS IS" BASIS,
//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//- See the License for the specific language governing permissions and
//- limitations under the License.
//- Copyright (C) 2018-Jun. 2023 Chatopera Inc, <https://www.chatopera.com>
//- Licensed under the Apache License, Version 2.0
//- http://www.apache.org/licenses/LICENSE-2.0
.uk-layui-form
    form.layui-form.uk-form(action='/admin/template/update.html')
        input(type='hidden', name='templettype', value=sysDic.id)
        input(type='hidden', name='id', value=template.id)
        .layui-form-item
            label.layui-form-label 模板名称：
            .layui-input-inline
                input.layui-input(type='text', name='name', value=template.name, required, lay-verify='required', placeholder='请输入模板名称', autocomplete='off')
            .layui-form-mid.layui-word-aux
                font(color='red') *
                | 模板名称，请使用字母填写

        .layui-form-item
            label.layui-form-label 模板代码：
            .layui-input-inline
                input.layui-input(type='text', name='code', placeholder='请输入模板代码', value=template.code, autocomplete='off')

            if sysDic.discode == true
                .layui-form-item
                    label.layui-form-label 图标：
                    .layui-input-inline
                        input(type="text", name="iconstr", required, lay-verify="required", value=template.iconstr,  placeholder="请输入模板图标", autocomplete="off", class="layui-input")
                        .layui-form-mid.layui-word-aux
                            font(color="red") *
                            span 模板图标，显示的图标路径

                if sysDic.ctype == "layout"
                    .layui-form-item
                        label.layui-form-label 列数：
                        .layui-input-inline
                            select(name="layoutcols" lay-verify="")
                                - var opt = 1
                                while opt <= 12
                                    option(value="#{opt}", selected=(template.layoutcols == opt ? 'selected' : false)) #{opt}列
                                    opt++

                        .layui-form-mid.layui-word-aux
                            font(color="red") *
                            span 布局模板的列数量

                if sysDic.ctype == "report"
                    //  - comment out by original file
                    //  - https://gitlab.chatopera.com/chatopera/cskefu/blob/760e130e770a96a43e8f6f2c8a1eb0885c0bbf90/contact-center/app/src/main/resources/templates/admin/system/template/edit.html
                    //  - <#include "/public/macro.html">
                    //         &lt;!&ndash; <div class="layui-form-item">
                    //             <label class="layui-form-label">样例数据：</label>
                    //             <div class="layui-input-inline">
                    //                 <@select "com.dic.template.datatype" "datatype" template.datatype!'' "lay-ignore required" "width: 220px;"/>
                    //             </div>
                    //             <div class="layui-form-mid layui-word-aux">
                    //             	<font color="red">*</font>
                    //             	报表默认数据
                    //             </div>
                    .layui-form-item
                        .layui-form-label 报表类型：
                        .layui-input-inline
                            input(type="text", name="charttype", required, lay-verify="required", value=template.charttype, placeholder="请输入报表类型", autocomplete="off", class="layui-input")

        .layui-form-button
            .layui-button-block
                button.layui-btn(lay-submit, lay-filter='formDemo') 立即提交
                button.layui-btn.layui-btn-original(type='reset') 重置

script.
    layui.use('form', function () {
        var form = layui.form();
        form.render();
    });

